package com.ruoyi.project.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.ReminderLogsMapper;
import com.ruoyi.project.system.domain.ReminderLogs;
import com.ruoyi.project.system.service.IReminderLogsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 提醒执行记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-16
 */
@Service
public class ReminderLogsServiceImpl implements IReminderLogsService {
    @Autowired
    private ReminderLogsMapper reminderLogsMapper;

    /**
     * 查询提醒执行记录
     * 
     * @param id 提醒执行记录主键
     * @return 提醒执行记录
     */
    @Override
    public ReminderLogs selectReminderLogsById(Long id) {
        return reminderLogsMapper.selectReminderLogsById(id);
    }

    /**
     * 查询提醒执行记录列表
     * 
     * @param reminderLogs 提醒执行记录
     * @return 提醒执行记录
     */
    @Override
    public List<ReminderLogs> selectReminderLogsList(ReminderLogs reminderLogs) {
        return reminderLogsMapper.selectReminderLogsList(reminderLogs);
    }

    /**
     * 获取任务最新的提醒记录
     * 
     * @param taskId 任务ID
     * @return 最新的提醒记录
     */
    @Override
    public ReminderLogs selectLatestReminderLogByTaskId(Long taskId) {
        return reminderLogsMapper.selectLatestReminderLogByTaskId(taskId);
    }

    /**
     * 新增提醒执行记录
     * 
     * @param reminderLogs 提醒执行记录
     * @return 结果
     */
    @Override
    public int insertReminderLogs(ReminderLogs reminderLogs) {
        return reminderLogsMapper.insertReminderLogs(reminderLogs);
    }

    /**
     * 修改提醒执行记录
     * 
     * @param reminderLogs 提醒执行记录
     * @return 结果
     */
    @Override
    public int updateReminderLogs(ReminderLogs reminderLogs) {
        return reminderLogsMapper.updateReminderLogs(reminderLogs);
    }

    /**
     * 批量删除提醒执行记录
     * 
     * @param ids 需要删除的提醒执行记录主键
     * @return 结果
     */
    @Override
    public int deleteReminderLogsByIds(String ids) {
        return reminderLogsMapper.deleteReminderLogsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除提醒执行记录信息
     * 
     * @param id 提醒执行记录主键
     * @return 结果
     */
    @Override
    public int deleteReminderLogsById(Long id) {
        return reminderLogsMapper.deleteReminderLogsById(id);
    }

    /**
     * 根据用户ID查询提醒执行记录
     * 
     * @param userId 用户ID
     * @return 提醒执行记录集合
     */
    @Override
    public List<ReminderLogs> selectReminderLogsByUserId(Long userId) {
        return reminderLogsMapper.selectReminderLogsByUserId(userId);
    }

    /**
     * 根据消息ID查询提醒执行记录
     * 
     * @param messageId 消息ID
     * @return 提醒执行记录
     */
    @Override
    public ReminderLogs selectReminderLogsByMessageId(String messageId) {
        return reminderLogsMapper.selectReminderLogsByMessageId(messageId);
    }

    /**
     * 根据设备ID查询提醒执行记录
     * 
     * @param deviceId 设备ID
     * @return 提醒执行记录集合
     */
    @Override
    public List<ReminderLogs> selectReminderLogsByDeviceId(String deviceId) {
        return reminderLogsMapper.selectReminderLogsByDeviceId(deviceId);
    }

    /**
     * 根据任务ID删除提醒执行记录
     * 
     * @param taskId 任务ID
     * @return 结果
     */
    @Override
    public int deleteReminderLogsByTaskId(Long taskId) {
        return reminderLogsMapper.deleteReminderLogsByTaskId(taskId);
    }
}
